<script>
    function post() {
        $.post('<?php echo base_url(); ?>reservation/editPayment/', {
            payment_id: $("#service").val().split('|')[0],
            jumlah: $("#unit").val(),
            desc: $('#desc').val(),
            resv_paym_id: <?php echo $data['resv_paym_id']; ?>
        }, function() {
            window.location.replace(document.referrer);
        });
    }
</script>
<table class="table table-bordered table-hover table-condensed">
    <tr>
        <td>Pilih Payment Type</td>
        <td>
            <select id="service">
                <?php
                foreach ($data2 as $row) {
                    echo '<option ';
                    if ($row['payment_id'] == $data['payment_id']) {
                        echo 'selected';
                    }
                    echo ' value="' . $row['payment_id'] . '" >' . $row['payment_name'] . '</option>';
                }
                ?></select><span id="price"></span>
        </td>
    </tr>
    <tr>
        <td>Jumlah</td>
        <td>
            <input id="unit" type="number" value="<?php echo $data['resv_paym_total']; ?>"/>
        </td>
    </tr>
    <tr>
        <td>Deskripsi</td>
        <td>
            <textarea id="desc"><?php echo $data['resv_paym_desc']; ?></textarea>
        </td>
    </tr>
</table>
<a class="btn btn-primary" href="javascript:void(0)" onclick="javascript:post();">Save</a>
